package fun.formoji.service.impl;

import org.springframework.stereotype.Service;

import cn.pecs.api.note.Note;
import cn.pecs.api.note.Note.NoteResult;
import cn.pecs.api.note.NoteServiceGrpc.NoteServiceBlockingStub;
import fun.formoji.service.NoteService;
import net.devh.boot.grpc.client.inject.GrpcClient;

@Service
public class NoteServiceImpl implements NoteService{

    @GrpcClient("local-grpc-server")
    private NoteServiceBlockingStub noteService;
    @Override
    public String getNote() {
        Note.NoteDto note = Note.NoteDto.newBuilder().setId(147191225296072704L).build();
        NoteResult noteResult = noteService.getNote(note);
        return noteResult.getData().getContent();
    }
    
}
